<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script>
        window.onload = function() {
            var btn = document.getElementsByTagName('input');
            for(var i = 0;i < btn.length;i++) {
                btn[i].onclick = function(){
                    for(var j = 0;j<btn.length;j++){
                        btn[j].value = '怀孕了';
                    }
                    this.value = '没怀孕';

                }
            }
        }

    </script>
</head>
<body>
    <input type="button" value="怀孕了">
    <input type="button" value="怀孕了">
    <input type="button" value="怀孕了">
    <input type="button" value="怀孕了">
    <input type="button" value="怀孕了">
</body>
</html>